const path = require('path')
const { merge } = require('webpack-merge')
const BaseWebpackConfig = require('./webpack.base.conf')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = merge(BaseWebpackConfig, {
  mode: 'development',
  output: {
    path: path.resolve(__dirname, '../dist'),
    filename: './js/[name].[chunkhash].js',
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './public/index.html',
      filename: 'index.html',
      title: 'Dev of Download Area',
      inject: 'body',
    }),
  ],
  devServer: {
    hot: true,
    open: false,
    port: 8080,
    host: '0.0.0.0',
    historyApiFallback: {
			index: '/index.html'
		}
  },
})
